package com.xiaohe66.web.domain.im.value;

import com.xiaohe66.common.util.Assert;
import com.xiaohe66.common.value.ErrorCodeEnum;
import com.xiaohe66.web.integration.domain.StringValue;
import lombok.EqualsAndHashCode;
import lombok.NonNull;

/**
 * @author xiaohe
 * @since 2023.09.07 16:22
 */
@EqualsAndHashCode(callSuper = true)
public class ImUserSignature extends StringValue {

    public static final ImUserSignature EMPTY = new ImUserSignature("");

    public ImUserSignature(@NonNull String value) {
        super(value);

        Assert.requireTrue(value.length() <= 128, ErrorCodeEnum.PARAM_ERROR, "昵称过长");
    }

    @Override
    public String toString() {
        return "ImUserSignature(" + getValue() + ")";
    }
}
